<template>
  <div class="pantry">
    <TopNav/>
    <div class="container">
      <h1>THE PANTRY</h1>
      <h2>The must haves stocked up in your fridge and pantry to make sure you can always make something tasty.
        Obviously
        not all of these ingredients have a long shelf life, but always nice to have.</h2>
      <div class="content">
        <div v-for="(item, index) in pantryItems" :key="index">
          <PantryBox :title="item.title" :items="item.items"/>
        </div>
      </div>
    </div>
    <Footer/>
  </div>
</template>

<script setup lang="ts">
import TopNav from '@/components/TopNav.vue'
import PantryBox from '@/components/PantryBox.vue'
import Footer from '@/components/FooterIndex.vue'
import pantryData from '@/data/pantryData'

const pantryItems = pantryData
</script>

<style scoped lang="scss">
.pantry {
  background-color: #F4D3C4;
}

h1 {
  font-size: 60px;
  color: #000000;
  text-align: left;
  @media (max-width: 768px) {
    font-size: 48px;
  }
}

h2 {
  color: #000000;
  font-size: 24px;
  text-align: left;
  font-weight: normal;
  @media (max-width: 768px) {
    font-size: 18px;
  }
}

.content {
  display: grid;
  grid-template-columns: repeat(3, 1fr); // 大屏幕上每行3个
  gap: 20px;

  @media (max-width: 1200px) {
    grid-template-columns: repeat(2, 1fr); // 中屏幕上每行2个
  }

  @media (max-width: 800px) {
    grid-template-columns: 1fr; // 小屏幕上每行1个
  }
}

.container {
  width: calc(90%);
  max-width: 1360px;
  margin: 0 auto;
  padding: 100px 0;
}
</style>
